<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once '../php_class/RegistManager.php';
require_once '../php_class/Security.php';
require_once '../../html/fb_login.php';

$id = htmlspecialchars($_POST['name']);;
$mail = htmlspecialchars($_POST['mail']);
$pass = htmlspecialchars($_POST['pass']);

$rm = new RegistManager();
$bool = $rm->checkAccountName($id);
if($bool  === true){
	$bool = $rm->doRegist($id, $mail, $pass);
}
else{
	header('Location: http://localhost/SocialAlbum/html/register.html?pm=1');
	return ;
}
if ($bool === true)
//	header('Location: http://localhost/SocialAlbum/html/index.php');
		$login = new FacebookLogin();
        $url = $login->getLoginUrl();
		header('Location: '.$url);
//}
?>
